package com.niodata.dp.app;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.niodata.dp.task.entity.ParamType;
import java.util.Date;

/**
 * app variable.flow could ref variables of app.
 */

public class AppVariable {

  private String appId;
  private String appCode;
  private String name;
  private VariableType type;
  private boolean bind;
  private String bindTask;
  private String bindJob;
  private String bindParam;
  private Date bindTime;
  private Object initValue;

  private VariableValue currentValue;
  private VariableValue previousValue;
  private String description;
  private Date upTime;
  private Date initTime;//first time assign value
  private ParamType paramType;

  public String getAppCode() {
    return appCode;
  }

  public void setAppCode(String appCode) {
    this.appCode = appCode;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public VariableType getType() {
    return type;
  }

  public void setType(VariableType type) {
    this.type = type;
  }

  public boolean isBind() {
    return bind;
  }

  public void setBind(boolean bind) {
    this.bind = bind;
  }

  public String getBindTask() {
    return bindTask;
  }

  public void setBindTask(String bindTask) {
    this.bindTask = bindTask;
  }

  public String getBindJob() {
    return bindJob;
  }

  public void setBindJob(String bindJob) {
    this.bindJob = bindJob;
  }

  public String getBindParam() {
    return bindParam;
  }

  public void setBindParam(String bindParam) {
    this.bindParam = bindParam;
  }

  public Date getBindTime() {
    return bindTime;
  }

  public void setBindTime(Date bindTime) {
    this.bindTime = bindTime;
  }

  public VariableValue getCurrentValue() {
    return currentValue;
  }

  @JsonDeserialize(using = AppVariableJsonDeserializer.class)
  public void setCurrentValue(VariableValue currentValue) {
    this.currentValue = currentValue;
  }

  public VariableValue getPreviousValue() {
    return previousValue;
  }

  public void setPreviousValue(VariableValue previousValue) {
    this.previousValue = previousValue;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public Date getUpTime() {
    return upTime;
  }

  public void setUpTime(Date upTime) {
    this.upTime = upTime;
  }

  public String getAppId() {
    return appId;
  }

  public void setAppId(String appId) {
    this.appId = appId;
  }

  public ParamType getParamType() {
    return paramType;
  }

  public void setParamType(ParamType paramType) {
    this.paramType = paramType;
  }

  public Date getInitTime() {
    return initTime;
  }

  public void setInitTime(Date initTime) {
    this.initTime = initTime;
  }

  public Object getInitValue() {
    return initValue;
  }

  public void setInitValue(Object initValue) {
    this.initValue = initValue;
  }

}
